<!DOCTYPE HTML>
<html>
    <meta charset="utf-8">
    <head>
  <title>20210916作业</title>
  <style>
.box1{width: 280px;height: 280px;background: #000000; border-radius: 90%;}
.h{ color: #ffffff;
    padding-top: 50px;
    text-align: center;
}

  </style>
    
  </head>
    <body>
        
<div class="box1"><div class="h">
    <h4 id="djs">还剩下xx秒，加油！</h4><br>
<h2 onclick="tz()">点击重新开始</h2>
</div>
</div>

     
 <script>
     function tz(){
         location.href='index.html';
     }
  console.log("接收到左边选择器的值为："+window.localStorage.getItem('t1'));
  console.log("接收到右边选择器的值为："+window.localStorage.getItem('t2'));
  var a=window.localStorage.getItem('t1');
  var b=a*60;
  document.getElementById("djs").innerHTML = "还剩下"+b+"秒，加油！";
  time();
  function time() {
       b=b-1;
       if(b===0){
           document.getElementById("djs").innerHTML = "时间到！";
       }else{
setTimeout("time()", 1000)
   
    document.getElementById("djs").innerHTML = "还剩下"+b+"秒，加油！";}
  }
 </script>

        
    </body>
</html>